package com.syedu.cels.entity;

import lombok.Data;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

/**
 * description：成绩实体类
 * @author Administrator
 * @date 2022/4/28 10:00
 */
@Data
public class TestResult {
    private Integer totalQuestion;
    private Integer rightAnswer;
    private Integer wrongAnswer;
    private Double rightRank;
    private String description;
    private LocalDateTime testTime;

    @Override
    public String toString() {
        String result = "测试结果:\n\t总题数: " + totalQuestion +
                "\n\t测试时间: " + testTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")) +
                "\n\t正确数: " + rightAnswer +
                "\n\t错误数: " + wrongAnswer +
                "\n\t正确率: " + rightRank +
                "\n\t评价: " + description;
        return result;
    }
}